package com.ysd.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ysd.dao.impl.NewsTableDaoImpl;
import com.ysd.dao.impl.Shangxia;
import com.ysd.dao.impl.xinwenDaoImpl;
import com.ysd.entity.Detailsinfo;
import com.ysd.entity.NewsTable;


public class NewDetallServlet extends HttpServlet {
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		NewsTableDaoImpl xinwen = new NewsTableDaoImpl();
		List<NewsTable> list = xinwen.getNewsTable();
		request.setAttribute("list", list);
		
		int newsId = Integer.parseInt(request.getParameter("s"));
		Shangxia Dao = new Shangxia();
		 List<Detailsinfo> dlist = Dao.Detailsinfo(newsId);
		 request.setAttribute("shang", dlist);
		
		 int newsId1 = Integer.parseInt(request.getParameter("s"));
			Shangxia xDao = new Shangxia();
			 List<Detailsinfo> xlist = xDao.xia(newsId1);
			 request.setAttribute("xia", xlist);
		 
		int newsId11 = Integer.parseInt(request.getParameter("s"));
		xinwenDaoImpl ao = new xinwenDaoImpl();
		 List<Detailsinfo> wlist = ao.xin(newsId11);
		 request.setAttribute("xin", wlist);
		request.getRequestDispatcher("article_list_content.jsp").forward(request, response);
	}
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
